//
//  LBCategorySettingModel.h
//  AFNetworking
//
//  Created by luckyRoy on 2018/2/2.
//

#import <Foundation/Foundation.h>
#import "LBCategoryModel.h"
#import "LBCategoryManagerURL.h"
#import "LBNewCategoryMainView.h"
#import "LBCategoryMainView.h"

typedef void(^LBCategoryHomePageChangeBlock)(void);

typedef void(^LBCategoryThreeLevelChangeBlock)(void);

typedef void(^LBCategorySearchLevelChangeBlock)(void);

typedef enum : NSUInteger {
    LBCategoryCategoryChoseBackDircetionBack,//向后跳转 default
    LBCategoryCategoryChoseBackDircetionForward,//向前跳转
} LBCategoryCategoryChoseBackDircetion;

@interface LBCategorySettingModel : NSObject

@property (nonatomic, copy) LBCategoryHomePageChangeBlock homePageChangeBlock;

@property (nonatomic, copy) LBCategoryThreeLevelChangeBlock threeLevelChangeBlock;

@property (nonatomic, copy) LBCategorySearchLevelChangeBlock searchLevelChangeBlock;

@property (nonatomic, copy) LBCategoryMainViewBlock confirmBlock;

@property (nonatomic, assign) NSInteger maxLevel;

@property (nonatomic, assign) LBCategoryCategoryChoseBackDircetion choseDircetion;

@property (nonatomic, assign) BOOL isSingleSelected;

@property (nonatomic, assign) BOOL isShowAll;

@property (nonatomic, assign) BOOL isEdiotr;//booking is Yes other is No

@property (nonatomic, assign) LBCategoryBizCodeType codeType;

@property (nonatomic, strong,readonly) NSMutableArray <NSArray <LBCategoryModel *> *>*originalArray;

@property (nonatomic, strong) NSMutableArray *selectedModelArray;
//存放三级界面临时选中数据
@property (nonatomic, strong) NSMutableArray *threePageSelectedModelArray;
//存放搜索界面临时选中数据
@property (nonatomic, strong) NSMutableArray *searchPageSelectedModelArray;

//@property (nonatomic, strong) NSMutableArray *currentSelectedModelArray;

@property (nonatomic, strong,readonly) NSMutableArray *currentShowArray;

- (void)setOriginalArrayByData:(NSArray *)modelArray;

- (void)setCurrentShowArrayByData:(NSArray *)modelArray;

- (NSMutableArray *)getOriginalArrayByOriginalData:(NSArray *)originalData;

- (void)addCategoryModel:(LBCategoryModel *)model currentPage:(LBCategorySettingPageType)page;

- (void)onlyAddCategoryModel:(LBCategoryModel *)model currentPage:(LBCategorySettingPageType)page;

- (void)removeCategoryModel:(LBCategoryModel *)model currentPage:(LBCategorySettingPageType)page;

- (void)onlyRemoveCategoryModel:(LBCategoryModel *)model currentPage:(LBCategorySettingPageType)page;

- (BOOL)containsCategoryCode:(NSString *)code fromSelectedArray:(NSArray *)selectedArray;

- (BOOL)isShowNextLevel:(NSInteger)currentLevel;

- (void)dealWithSelectedArrayFromPage:(LBCategorySettingPageType)fromPage
                               toPage:(LBCategorySettingPageType)toPage;

- (BOOL)isShowTopSelectedView;

- (BOOL)isBookingCodeType;

- (NSMutableArray *)getSearchAllModel;
//
//- (void)dealWithRealSelectedByCancelCodeArray:(NSArray *)codeArray
//                           selectedModelArray:(NSArray *)selectedModelArray;

+ (NSMutableArray *)selectedModelArrayFromCodeArray:(NSArray *)codeArray
                                         totalArray:(NSArray *)totalArray
                                   isSingleSelected:(BOOL)isSingleSelected;

+ (NSMutableArray *)getListModelBySettingModel:(LBCategorySettingModel *)settingModel
                                   currentPage:(LBCategorySettingPageType)page;

+ (BOOL)isBookingViewByCodeType:(LBCategoryBizCodeType)codeType;

+ (NSMutableArray *)getCopyByOriginalData:(NSArray <LBCategoryModel *> *)originalData;

@end
